<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="/bigjo/js/jquery.js"></script>
<title>Insert title here</title>
</head>
<style type="text/css">
	#sreply{
		position:relative;
		width: 20Em;
		height: 50px;
	}
</style>

<script type="text/javascript">
jQuery.noConflict();
jQuery(".newreplybutton").click(function(){
	var idx = document.URL.indexOf("bigjo");
	var str = document.URL.substring(0,idx+5);
	var sr_no = jQuery(this).attr("id");
	alert(sr_no);
	jQuery.ajax({
		url:str + "/BoardReplyreply.reply?sr_no="+sr_no,
		error:function(data){
			alert("오류 발생");
		},
		success : function(data){
			alert("성공");
			jQuery("#replyreply").append(data);
		}
	});
});

jQuery.noConflict();
var sr_no = jQuery(".test").attr("id");
jQuery(".insertreply").click(function(){
	var idx = document.URL.indexOf("bigjo");
	var str = document.URL.substring(0,idx+5);
	var sr_no = jQuery(this).attr("id");
	var sb_no = jQuery("#replysb_no").val();
	alert("게시판 시퀀스값: "+sb_no);
	alert("댓글의 시퀀스값: "+sr_no);
	jQuery.ajax({
		url:str + "/replyform.reply?sr_no="+sr_no+"&sb_no="+sb_no,
		error:function(data){
			alert("오류 발생");
		},
		success : function(data){
			jQuery("#test"+sr_no).html(data);
		}
	});
});
</script>
<body>
<div id="sreply">
	<div align="left"><!-- 새로운 댓글을 달은곳에 댓글버튼을 클릭했을때 리플내용이 나오는 곳  -->
	<c:forEach var="newreply" items="${newreply}">
	<div>
		<input type="hidden" id="${newreply.sr_no}" class="newreplybutton"><label>${newreply.sr_m_id}</label>
		<label>${newreply.sr_context}</label>&nbsp;&nbsp;&nbsp;<a class="insertreply" id="${newreply.sr_no}"style="size: 10px">댓글</a>
	</div>
	<div>
			<%-- <td colspan="3"><div class="${reply.sr_no}List"></div></td> --%>
			<jsp:include page="/BoardReplyreply.reply?sr_no=${newreply.sr_no}"></jsp:include>
	</div>
	</c:forEach>
	</div>
	<div id="replyreply"></div>
</div>
</body>
</html>